<?php

namespace common\validate;


class OriginalPlanNode extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    public function sceneGetDailyList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.step_category_id', 'require')
            ->append('param.start_time', 'require|integer')
            ->append('param.end_time', 'require|integer');
    }

    public function sceneGetDailyStatList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
//            ->append('param.step_category_id', 'require')
            ->append('param.target_step_category_id', 'integer')
            ->append('param.start_time', 'require|integer')
            ->append('param.end_time', 'require|integer');
    }

    public function sceneGetDailyDelayList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.start_time', 'require|integer')
            ->append('param.end_time', 'require|integer');
    }

    public function sceneGetEntityTaskList()
    {
        return $this->append('param.project_id', 'require|integer')
            ->append('param.source_entity_id', 'require|max:1000');
    }

    public function sceneGetDelayListByTaskId()
    {
        return $this->append('param.task_ids', 'require|max:1000');
    }

    public function sceneGetWorkOrderListByTaskId()
    {
        return $this->append('param.task_ids', 'require|max:1000');
    }

    public function sceneGetDelayOrderTaskStepCategoryConfirm()
    {
        return $this->append('param.delay_order_task_id', 'require|max:1000');
    }

    public function sceneGetTaskWorkOrderProblemStepCategory()
    {
        return $this->append('param.task_work_order_id', 'require|max:1000');
    }

    public function sceneGetDemandOrderDelayList()
    {
        return $this->append('param.demand_order_id', 'require|max:1000');
    }

    public function sceneGetSourceTaskList()
    {
        return $this->append('param.task_ids', 'require|max:1000');
    }

    public function scenePlanNodeReport()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.report_date', 'require|integer')
            ->append('param.step_category_id', 'require');
    }

    public function scenePlanNodeReportList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.report_date', 'require|integer');
    }

    public function sceneGetDailyAbnormalReport()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.report_date', 'require|integer');
    }

    public function sceneGetAbnormalTaskList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.time_range', 'require|array');
    }

    public function sceneGetAbnormalTaskWorkOrderList()
    {
        return $this
            ->append('param.project_id', 'require|integer')
            ->append('param.task_ids', 'require|max:100')
            ->append('param.time_range', 'require|array');
    }

    // 按分类统计异常任务数量最多统计按实体去重
    public function sceneCountAbnormalEntity()
    {
        return $this
            ->append('param.entity_module_code', 'require|in:episode,shot,asset')
            ->append('param.project_id', 'require|integer')
            ->append('param.time_range', 'require|array');
    }

    // 按分类统计异常任务数量最多统计按任务去重
    public function sceneCountAbnormalTask()
    {
        return $this
            ->append('param.step_type', 'require|in:step,step_category,to_do,work_order_to_do,entity_to_do,standard_meeting,standard_review,standard_make_to_do,template_to_do,person')
            ->append('param.project_id', 'require|integer')
            ->append('param.time_range', 'require|array');
    }

    // 获取今天存在异常的集数列表，附带异常实体数据统计
    public function sceneGetTodayExistAbnormalEpisodeList()
    {
        return $this
            ->append('param.entity_module_code', 'require|in:episode,shot,asset,step,step_category,to_do,work_order_to_do,entity_to_do,standard_meeting,standard_review,standard_make_to_do,template_to_do,person')
            ->append('param.project_id', 'require|integer');
    }

    // GetEpisodeAbnormalEntityList 获取异常实体列表，包含异常任务ids
    public function sceneGetEpisodeAbnormalEntityList()
    {
        return $this
            ->append('param.entity_module_code', 'require|in:episode,shot,asset')
            ->append('param.project_id', 'require|integer')
            ->append('param.time_range', 'require|array')
            ->append('param.initial_episode_code', 'require')
            ->append('param.page', 'require|array');
    }

    // GetEpisodeAbnormalTaskMapByEntity 获取异常实体列表，包含异常任务ids
    public function sceneGetEpisodeAbnormalTaskMapByEntity()
    {
        return $this
            ->append('param.entity_module_code', 'require|in:episode,shot,asset')
            ->append('param.project_id', 'require|integer')
            ->append('param.entity_ids', 'require|array');
    }

    // GetEpisodeAbnormalTaskList 获取异常任务列表
    public function sceneGetEpisodeAbnormalTaskList()
    {
        return $this
            ->append('param.step_type', 'require|in:step,step_category,to_do,work_order_to_do,entity_to_do,standard_meeting,standard_review,standard_make_to_do,template_to_do,person')
            ->append('param.project_id', 'require|integer')
            ->append('param.time_range', 'require|array')
            ->append('param.initial_episode_code', 'require')
            ->append('param.page', 'require|array');
    }

    // GetEpisodeAbnormalTaskMap 获取异常任务列表
    public function sceneGetEpisodeAbnormalTaskMapByTask()
    {
        return $this
            ->append('param.step_type', 'require|in:step,step_category,to_do,work_order_to_do,entity_to_do,standard_meeting,standard_review,standard_make_to_do,template_to_do,person')
            ->append('param.project_id', 'require|integer')
            ->append('param.task_ids', 'require|array');
    }
}
